<?php

//Variables
$myNumberVariable = 1;
$myStringVariable = "Casper";

//Arrays
$myStringArray = array("Index0", "Index1", "Index2", "Index3", "Index4");

$myArray = array();

array_push($myArray, "Item0");
array_push($myArray, "Item1");
array_push($myArray, "Item2");

//Loops
for ($i=0; $i < 10; $i++) { 
	echp $i;
}

foreach($myStringArray as $s) {
	echo $i;
}


while($myNumberVariable < 10) {
	echo $myNumberVariable;
	$myNumberVariable++;
}

while($myNumberVariable < 10):
	echo $myNumberVariable;
	$myNumberVariable++;
endwhile;


do { 
	echo "<p>The loop ran even though the loop condition is false.</p>";
}
while ($loopCond) {
	echo "<p>Now the loop is done running.</p>";
}

//Simple functions

	//String lenght
	strlen($myName);

	//Substring
	substr($myName, 0, 3);

	//Substring position
	strpos($myName, "c")

	//Uppercase
	strtoupper($myName);

	//Lowercase
	strtolower($myName);

	//Rounding numbers
		//(number to round, number of decimals)
	round($myNumberVariable, 3);

	//Random
		//Prints a random number between and including the input parameters
	rand(1,10);

	//Join
		//Joining elements in an array with a comma seperator
	join(", ", $myStringArray);

	//Sort elements
	sort($myStringArray);

	//Reverse sort
	rsort($myStringArray;)

	//Count
	count($myStringArray);


 ?>